/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 artifact_prop_aligned_bonus.h

	$Header: /heroes4/artifact_prop_aligned_bonus.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ARTIFACT_PROP_ALIGNED_BONUS_H_INCLUDED )
#define ARTIFACT_PROP_ALIGNED_BONUS_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "artifact_prop_effect.h"

namespace t_artifact_prop
{

	// ----------------------------------------------------------------------
	// class for aligned bonus
	// ----------------------------------------------------------------------
	class t_aligned_bonus_base : public t_artifact_effect
	{
	public:

		virtual bool				accept( t_artifact_effect_visitor& visitor );
		t_town_type					get_alignment() const;
		int							get_health() const;
		int							get_speed() const;
		void						init( t_town_type alignment, int damage, int health, 
										  int speed, t_artifact_target target );
		virtual bool				read( std::streambuf& buffer );
		void						set_alignment( t_town_type arg );
		void						set_health( int arg );
		void						set_speed( int arg );
		virtual bool				write( std::streambuf& buffer ) const;
	protected:
		t_town_type m_alignment;
		int			m_health_bonus;
		int         m_speed_bonus;
	};

	inline void t_aligned_bonus_base::init( t_town_type alignment, int damage, int health, 
                                       int speed, t_artifact_target target )
	{
		t_artifact_effect::init( target, damage );
		m_alignment = alignment;
		m_health_bonus = health;
		m_speed_bonus = speed;
	}

	inline t_town_type	t_aligned_bonus_base::get_alignment() const
	{
		return m_alignment;
	}

	inline int t_aligned_bonus_base::get_health() const
	{
		return m_health_bonus;
	}

	inline int t_aligned_bonus_base::get_speed() const
	{
		return m_speed_bonus;
	}

	inline void t_aligned_bonus_base::set_alignment( t_town_type arg )
	{
		m_alignment = arg;
	}

	inline void t_aligned_bonus_base::set_health( int arg )
	{
		m_health_bonus = arg;
	}

	inline void t_aligned_bonus_base::set_speed( int arg )
	{
		m_speed_bonus = arg;
	}

	typedef t_effect< t_aligned_bonus_base, k_artifact_effect_aligned_bonus > t_aligned_bonus;

	inline t_artifact_effect* get_aligned_bonus( t_town_type alignment, int damage, int health, 
                                          int speed, t_artifact_target target )
	{
		return new t_aligned_bonus( alignment, damage, health, speed, target );
	}

};

#endif // ARTIFACT_PROP_ALIGNED_BONUS_H_INCLUDED